package com.punch.punchtable.repository;

import com.punch.punchtable.entity.Attendance;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface AttendanceRepository extends JpaRepository<Attendance, Long>{

    @Query(value = "select distinct dept from attendance" ,nativeQuery = true)
    List<String> findAllDept();

//    @Transactional
//    @Modifying
//    @Query(value = "update attendance a,leader l set a.role=1 where a.usernum = l.leader_num",nativeQuery = true)
//    void findAllByRole();

}
